

/**
 * 闪电天气
 */

 import LightningShader from '../shader/LightningShader.glsl?raw'
 import { v4 as uuid } from 'uuid'
 
 export default class Fog {
   /**
    * 
    * @param {*} viewer 
    * @param {*} options 
    */
 
   constructor(viewer, options = {}) {
     this._viewer = viewer
     this._delegate = undefined
   }
 
 
   mounted() {
     this._delegate = new Cesium.PostProcessStage({
       name: uuid(),
       fragmentShader: LightningShader,
       uniforms: {
         
       }
     })
     
   }
 
   /**
    * 添加后处理效果
    * @returns 
    */
 
   start() {
     !this._delegate && this.mounted()
     this._delegate && this._viewer.scene.postProcessStages.add(this._delegate)
     return this
   }
 
   /**
    * 停止渲染
    */
 
   stop() {
     this._delegate && this._viewer.scene.postProcessStages.remove(this._delegate)
     this._delegate = undefined
   }
 
 
 }
 